<template>
	<view class="page">
		<u-list @scrolltolower="scrolltolower">
			<u-list-item class="u-list-item" v-for="(item, index) in list">
		<view class="menu-box"  @click='handleJump(item)'>
        <view class="menu-item">
					<view class=" mar-bottom23 flex justify-between align-center">
						<view class="font_s26 cr-333"> {{item.contentItemName}} </view>
						
					</view>
          
            <view class="font_s24 cr-999"> 点赞时间 {{item.createTime}} </view>
					
        </view>
      </view>
	  </u-list-item>
	  </u-list>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list:[],
				limit:10,
				page:1,
				total:0,
				
			};
		}
		,
		onLoad(payload) {
			this.init()
		},
		methods:{
      handleJump(item){
        console.log(11111,item)
        if(item.deleteStatus){
          uni.showToast({
            title:'内容已删除',
            icon:'none'
          })
          return
        }
        if(!item.publishStatus){
          uni.showToast({
            title:'内容已下架',
            icon:'none'
          })
          return
        }
        let url = ''
        switch(item.type){
        	case 1:
        	 url = `/pages/imgtxtDetails/imgtxtDetails?id=${item.contentItemId}`
        	break;
        	case 2:
        		url = `/pages/VideoItemDetail/VideoItemDetail?id=${item.contentItemId}`
        	break;
        	case 3:
        		url = `/pages/AudioItemList/AudioItemList?id=${item.albumId}&cid=${item.contentItemId}`
        	break;
        }
        uni.navigateTo({
        	url
        })
      },
			init(){
				this.getLikeList(true)
			},
			getLikeList(init){
				if(init||this.total>this.list.length){
						return this.$http.get(
							`/yaolexue-service-portal/contentItemLikeRel/pageContentItemLike`, {
								limit:this.limit,
								page:this.page,
							}, ).then(res=>{
								console.log(res);
								this.list=res.data.items
								this.total=res.data.total
							})
				}
			},
			scrolltolower() {
				this.page+=1
				this.getLikeList()
			},
		}
	}
</script>

<style lang="scss">
.page {
  padding: 0 31rpx;
}
.menu-box{
		width: 689rpx;
		background: #FFFFFF;
		margin: 20rpx auto;
		.menu-item{
			width: 100%;
			padding-bottom: 30rpx;
			padding-top: 30rpx;
			box-sizing: border-box;
				border-bottom: 1rpx solid rgba(240, 240, 240, 0.8);
		}
	}
</style>
